/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.heathrowapi;

import cz.muni.fi.heathrowapi.dto.DestinationDTO;
import java.util.List;

/**
 *
 * @author Jan Richter
 */
public interface DestinationService {
    /**
     * Stores destination to datastore and assigns id.
     * 
     * @param destination Destination to be stored.
     * @throws ServiceFailureException on failure.
     * @throws IllegalArgumentException if destination is null
     */
    public void createDestination(DestinationDTO destination);
    
    /**
     * Returns persisted Destination.
     * 
     * @param id Id of Destination to be found in datastore.
     * @throws ServiceFailureException on failure.
     * @return Persisted destination.
     */
    public DestinationDTO getDestination(Long id);
    
    /**
     * Updates existing destination.
     * 
     * @param destination Destination to be updated.
     * @throws ServiceFailureException on failure.
     * @throws IllegalArgumentException if destination is null
     */
    public void updateDestination(DestinationDTO destination);
    
    /**
     * Removes existing destination.
     * 
     * @param destination Destination to be removed.
     * @throws ServiceFailureException on failure.
     * @throws IllegalArgumentException if destination is null
     */
    public void deleteDestination(DestinationDTO destination);
    
    /**
     * Find all destinations.
     * 
     * @return list of all destinations
     * @throws ServiceFailureException on failure.
     */
    public List<DestinationDTO> findAll();
    
    
    public List<DestinationDTO> findDestinationWild(String text, int limit);
}
